/**
 * @Copyright:Copyright (c) 1992 - 2015
 * @Company: TengTong
 */
package com.tengtong.duang.action.mapping;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

import com.tengtong.duang.action.mapping.core.Url;
import com.tengtong.duang.action.mapping.core.UrlHandler;
import com.tengtong.duang.web.commons.ClientRequestMethod;

/**
 * 映射管理服务类
 *
 * @author jai
 * @since: v1.0
 */
public class UrlHandlerMappingManager {

	/**
	 * 映射表 <url, 映射列表>
	 */
	private final ConcurrentMap<Url, UrlHandlerMappingList> mappings = new ConcurrentHashMap<>();
	
	/**
	 * 使用 url 和请求方法来获取一个处理器
	 * 
	 * @param url
	 * @return
	 */
	public UrlHandler findUrlHandlerBy(Url url, ClientRequestMethod method){
		UrlHandlerMappingList list = mappings.get(url);
		UrlHandler result = list.findBy(method);
		
		if(result == null){
			
		}
		
		return result;
	}
	
}
